﻿<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>     
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
  <link href="<c:url value='/css/validateform.css'/>" rel="stylesheet"  type="text/css" />  
  <link href="<c:url value='/css/admin2.css'/>" rel="stylesheet"  type="text/css" />  

	  <link href="<c:url value='/css/admin.css'/>" rel="stylesheet"  type="text/css" />  	

	
        <script language="JavaScript" src="<c:url value='/js/jquery.js'/>"></script>

         <script type="text/javascript" src="<c:url value='/js/jquery.pagination.js'/>"></script>

		 
		         <script type="text/javascript">
   	
            $(document).ready(function(){
		
		
		

			   });

			    </script>
			
</head>

<body>
<!--main-->

<div align="center"><font color="red">${requestScope.tip }</font></div>
<div class="bian" style="width: 100%">
			<table width="100%" height="34" border="0" cellpadding="0" cellspacing="0" bgcolor="#DEECF3">
					<tr>
						<td width="16" align="right">&nbsp;</td>
						<td width="27" align="left"><img src="<c:url value='/images/frame/san2.gif'/>" width="17" height="16" /></td>
						<td width="571" align="left"><span class="wen2">
						<c:if test="${addorupdate=='add'}">
 <c:set var="addorupdateinfo" value="游戏场/游戏房间添加"/>
 </c:if>
 <c:if test="${addorupdate=='update'}">
 <c:set var="addorupdateinfo" value="游戏场/游戏房间修改"/>
 </c:if>${addorupdateinfo}
						</span></td>
						<td align="center" valign="middle"></td>
					</tr>
			</table>
</div>
<div style="padding:10px;">	
<form class="registerform" action="demo.html">
    <table width="100%" style="table-layout:fixed;">
		<tr>
            <td class="need" style="width:10px;">*</td>
            <td style="width:70px;">中文名：</td>
            <td style="width:205px;"><input type="text" value="" name="name" class="inputxt"  datatype="*" nullmsg="请输入中文名！" /></td>
            <td><div class="Validform_checktip"></div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>密码：</td>
            <td><input type="password" value="" name="userpassword" class="inputxt" datatype="*6-16" nullmsg="请设置密码！" errormsg="密码范围在6~16位之间！" /></td>
            <td><div class="Validform_checktip">密码范围在6~16位之间</div></td>
        </tr>

		<tr>
            <td class="need"></td>
            <td></td>
            <td colspan="2" style="padding:10px 0 18px 0;">
                <input type="submit" value="提 交" /> <input type="reset" value="重 置" /><span id="msgdemo" style="margin-left:30px;"></span>
            </td>
        </tr>
	</table>
</form>


</div>

<script type="text/javascript" src="<c:url value='/js/Validform.js'/>"></script> 

<script type="text/javascript">
$(function(){

	
	$(".registerform").Validform({
		tiptype:function(msg,o,cssctl){
			//msg：提示信息;
			//o:{obj:*,type:*}, obj指向的是当前验证的表单元素，type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态;
			//cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
			if(o.obj){//o.obj不为空说明是在检测表单元素;
				var objtip=o.obj.parent().next().find(".Validform_checktip");
				cssctl(objtip,o.type);
				objtip.text(msg);
			}else{//o.obj为空说明是表单提交操作;
				var objtip=$("#msgdemo");
				cssctl(objtip,o.type);
				objtip.text(msg);
			}
		},
		datatype:{//传入自定义datatype类型【方式二】;
			"z2-4" : /^[\u4E00-\u9FA5\uf900-\ufa2d]{2,4}$/,
			"*6-20": /^[^\s]{6,20}$/
		},
		ajaxPost:true,
		postonce:true
	});
	

})
</script>

</body>
</html>

<script>


</script>